<?php
class Admin_CarController extends  TIGT_Controller_Action{
    protected $_arrParam;
    public function init(){
        $layoutPath = TEMPLATE_PATH ."/admin";
        $option = array (	'layout' 		=> 'index',
        		'layoutPath' 	=> $layoutPath );
        Zend_Layout::startMvc ( $option );
        
        $this->_arrParam=$this->_request->getParams();
        
    }
    public function indexAction(){
    
    }
    public function addAction(){
        $this->view->headScript()->appendFile("/js/autoloadDistrict.js");
        Zend_Loader::loadClass("TransportcompanysModel");
        Zend_Loader::loadClass("ProvinceModel");
        Zend_Loader::loadClass("DistrictModel");
        $provinceModel=new ProvinceModel();
        $list_province=$provinceModel->fetchAll();
        $transportcompanysModel=new TransportcompanysModel();
        $list_transport=$transportcompanysModel->fetchAll();
        if(count($list_transport)){
            foreach ($list_transport as $t){
                $arr_transport[$t['idTransportCompany']]=$t['CompanyName'];
            }
        }
        $this->view->arr_transport=$arr_transport;
        $districtModel=new DistrictModel();
        $list_district=$districtModel->fetchAll();
        
        for($i=0;$i<=23;$i++){
            if($i<10) $arr_hour["0".$i]="0".$i;
            else $arr_hour[$i]=$i;            
        }
        for($i=0;$i<=59;$i++){
        	if($i<10) $arr_minute["0".$i]="0".$i;
        	else $arr_minute[$i]=$i;
        }
        
        $this->view->arr_hour=$arr_hour;
        $this->view->arr_minute=$arr_minute;
        $this->view->list_companys=$list_transport;
        $this->view->list_province=$list_province;
        $this->view->list_district=$list_district;
        
        
        
        if($this->_request->isPost()){
            $params=$this->_arrParam;
        }
    }
}